{#**
*
* 功能描述（留言列表模板）
*
* @author suoya <jlusuoya@gmail.com>
* @version 1
*#}
{#include file="header.tpl" title="title" active="msg" #}
{#include file="define.tpl" scope=parent#}
<div class="content middle">
    <div class="ui breadcrumb">
        <a class="section" href="index.php">主页</a>
        <i class="right"></i>
        <span class="active section">留言管理</span>
    </div>
    {#include file="search_bar.tpl" s_basic=['type'=>[0,'类别',$msg_types], 'status'=>[0,'状态',$msg_status]] s_keys=['title'=>'标题', 'content'=>'内容', 'file'=>'附件']#}
    <table class="ui table segment">
        <thead>
            <tr>
                <th>状态</th>
                <th>类别</th>
                <th>用户</th>
                <th>时间</th>
                <th>标题</th>
                <th>内容</th>
                <th>附件</th>
                <th>操作</th>
            </tr></thead>
        <tbody>
            {#foreach $msgs as $item#}
                <tr>
                    <td>{#$msg_status[$item['status']]#}</td>
                    <td>{#$msg_types[$item['type']]#}</td>
                    <td><a href="#" onclick="return showuser({#$item['userid']#})">{#$item['username']#}</a></td>
                    <td>{#$item['createtime']#}</td>
                    <td>{#$item['title']#}</td>
                    <td>{#$item['content']#}</td>
                    <td>{#if $item['attach'] != ''#}<a href="index.php?action=lvmsg.down&file={#$item['attach']#}">{#$item['file']#}</a>{#/if#}</td>
                    <td>
                        <select onchange="ajax_value(this, 'index.php?action=lvmsg.setstatus&id={#$item['id']#}&status=')">
                            {#foreach $msg_status as $k => $i#}
                                <option value="{#$k#}"{#if $item['status'] == $k#}selected="selected"{#/if#}>{#$i#}</option>
                            {#/foreach#}
                        </select>
                        <a href="index.php?action=lvmsg.remove&id={#$item['id']#}" onclick="ajax_this(this);return false">删除</a>
                    </td>
                <tr>
                {#/foreach#}
        </tbody>
        <tfoot>
            <tr><th colspan="8">
                    {#include file="paging_bar.tpl"#}
                </th>
            </tr></tfoot>
    </table>

</div>
{#include file="footer.tpl" #}
<script>
    $(document).ready(function() {
        $("#type").val({#$type#});
        $("#status").val({#$status#});
    });
</script> 
